package com.sicau.service.serviceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sicau.dao.StudentMapper;
import com.sicau.entity.Student;
import com.sicau.service.IDocService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by wzw on 2018/11/2
 */
@Service
public class DocServiceImpl implements IDocService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public PageInfo<Student> selectDocByPage1(int currentPage, int pageSize) {
        PageHelper.startPage(currentPage, pageSize);
        List<Student> docs = studentMapper.selectByPageAndSelections();
        PageInfo<Student> pageInfo = new PageInfo<>(docs);
        return pageInfo;
    }
}
